#include<iostream>
#include<vector>
#include<numeric>
#include<algorithm>
using namespace std;

void Print(int a)
{
	cout << a << " ";
 } 

int main()
{
	vector<int> v;
	for (int i = 0; i <= 100; i++)
	{
		v.push_back(i);
	}
	
	int ret = accumulate(v.begin(), v.end(), 0);
	cout << "sum form 0 to 100:" << ret << endl;
	
	for_each(v.begin(), v.end(), Print);
	cout << endl;
	
	fill(v.begin() + 1, v.end() - 1, 114);
	for_each(v.begin(), v.end(), Print);
	cout << endl;
	return 0;
}
